<template>
  <CategorySelector :disabled="isShow !== 1" />
  <SpuList
    v-if="isShow === 1"
    @setIsShow="isShow = $event"
    @setSpu="spu = $event"
  />
  <SaveOrupdateSpu
    v-else-if="isShow === 2"
    @setIsShow="isShow = $event"
    :spu="spu"
  />
  <SaveSku v-else @setIsShow="isShow = $event" :spu="spu" />
</template>

<script lang="ts">
export default {
  name: 'XSpu',
}
</script>

<script lang="ts" setup>
import { ref } from 'vue'
import CategorySelector from '@/components/CategorySelector/index.vue'
import SpuList from './components/SpuList.vue'
import SaveOrupdateSpu from './components/SaveOrupdateSpu.vue'
import SaveSku from './components/SaveSku.vue'

const isShow = ref(1)
const spu = ref({
  spuName: '',
  tmId: undefined,
  description: '',
  spuImageList: [],
  spuSaleAttrList: [],
})
</script>

<style scoped></style>
